<h3>Список обжор</h3>
<table class="view_products_table">
    <thead>
        <tr>
            <th>#</th>
            <th>Пользователь</th>
            <th><a href="<?php echo url_for('@view_statistic') ?>?sort=total">Сомы</a></th>
            <th><a href="<?php echo url_for('@view_statistic') ?>?sort=count">Заказы</a></th>
        </tr>
    </thead>
    <tbody>
        <?php
        $i = 1;
        $total = 0;
        $count = 0;
        foreach ($stast as $stat) {
            echo "<tr><td>";
            echo $i;
            echo "</td><td>";
            echo $stat->getUser()->getUsername();
            echo "</td><td>";
            $total += $stat->getTotals();
            echo $stat->getTotals();
            echo "</td><td>";
            $count += $stat->getCounter();
            echo $stat->getCounter();
            echo "</td></tr>";
            $i++;
        }
        ?>
    </tbody>
    <tfoot>
        <tr>
            <td></td>
            <td>Всего съедено:</td>
            <td><?php echo $total; ?></td>
            <td><?php echo $count; ?></td>
        </tr>
    </tfoot>
</table>